<template>
	<view class="container" >
		
		<view class="info-content">
			
			<view class="mc-item">
				<view class="mcil-info">
					<text v-if="info.classify">【 {{ info.classify }} 】</text>
					{{ info.title || ''}}
				</view>
				<view class="mcil-btm">
					<view class="mcilb-desc">
						{{ info.viewQuantity }} 浏览
					</view>
					<view class="mcilb-desc" >
						{{ info.createdTime ? info.createdTime.split(' ')[0] : '' }}
					</view>
				</view>
			</view>
			
			<view class="ic-list" v-if="info.replyList && info.replyList.length">
				<view class="ic-item" v-for="item in info.replyList" :key="item.id">
					<view class="ic-header">
						<view class="ich-left">
							<image :src="'https://coach-vehicle-uat-1313990257.cos.ap-beijing.myqcloud.com/miniapp/mine/user_avatar.png'" mode=""></image>
							<text>{{ item.replyUser ? '@' + item.replyUser : ''}}</text>
						</view>
						<view class="ich-right">
							{{ item.replyTime	? item.replyTime.split(' ')[0] : '' }}
						</view>			
					</view>
					
					<u-parse
						v-if="item.replyContent && item.replyContent.length"
						class="ic-desc"
						:content="item.replyContent	|| ''"
					></u-parse>
				</view>
				
			</view>
			
			
		</view>
		
	</view>
</template>

<script>
	import { mapGetters } from 'vuex'
	
	export default {
		data() {
			return {
				info: {}
			};
		},
		computed: {
			...mapGetters('user', ['getUserInfo']),
		},
		onLoad(query){
			const { questionId } = query
			this.getDetailInfo(questionId)
		},
		methods: {
			async getDetailInfo(questionId){
				const res = await this.$request({
					method: 'GET',
				  url: '/ltb-center/carFriendQuestion/detailWithReply',
					data: {
						questionId,
						userId: this.getUserInfo.id
					}
				})
				this.info = res.datas
			},
		}
	}
</script>

<style lang="scss" scoped>
.container {
	// height: 100%;
	width: 100%;
	background-color: #ffffff;
	.info-content {
		box-sizing: border-box;
		padding: 40rpx;
		
		.mc-item {
			margin-bottom: 20rpx;
			padding-bottom: 20rpx;
			box-sizing: border-box;
			border-radius: 8rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.mcil-info {
				font-size: 14px;
				color: rgba(0, 0, 0, 0.85);
				text-shadow: 0 0 0.1px currentColor;
				// overflow: hidden;
				// text-overflow: ellipsis;
				// display: -webkit-box;
				// -webkit-box-orient: vertical;
				// -webkit-line-clamp: 2;
			}
			.mcil-btm {
					margin-top: 52rpx;
					font-size: 14px;
					color: rgba(0, 0, 0, 0.45);
					display: flex;
					justify-content: space-between;
					align-items: center;
					.mcilb-desc {
						display: flex;
						align-items: center;
					}
				}
		}
		
		
		.ic-list {
			.ic-item {
				border-top: 1rpx solid #eeeeee;
				margin-bottom: 20rpx;
				.ic-header {
					display: flex;
					justify-content: space-between;
					align-items: center;
					font-size: 14px;
					margin: 36rpx 0;
					color: #666666;
					.ich-left {
						display: flex;
						align-items: center;
						image {
							width: 40rpx;
							height: 40rpx;
							border-radius: 50%;
							margin-right: 8rpx;
						}
					}
				}
				.ic-desc {
					overflow: hidden;
					font-size: 13px;
					/deep/ image {
						width: 100%;
					}
				}
			}
		}

		

	}
}
</style>
